﻿var myChart = echarts.init(document.getElementById('Diagram1'));
var myChart2 = echarts.init(document.getElementById('Diagram2'));
var myChart3 = echarts.init(document.getElementById('Diagram3'));
var myChart4 = echarts.init(document.getElementById('Diagram4'));
var myChart5 = echarts.init(document.getElementById('Diagram5'));
var myChart6 = echarts.init(document.getElementById('Diagram6'));

//点焊曲线图
function spotwelding(id) {
    showordisplaybydiv(0);
    var url1 = "api/SpotUnitMeasurementHistory?Part_Serial=" + $('#partSerial').val() + "&Pass_No=" + id;
    //后台数据加载
    $.ajax({
        type: "get",
        //async:false,
        contenttype: "applicaton/json;charset=utf-8",
        url: url1,
        datatype: 'json',
        success: function (json) {

            myChart.hideLoading();
            myChart2.hideLoading();
            myChart3.hideLoading();

            //debugger;
            if (json.RealTimeStress.length <= 1) {
                myChart.clear();
                myChart2.clear();
                myChart3.clear();
                return;
            }

            //焊枪压力
            myChart.setOption({
                title: {
                    text: '焊枪压力'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        show: true,
                        data: json.RealTimeStressTimePoints
                    }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    }
                }],
                series: [
                    {
                        name: '压力',
                        type: 'line',
                        data: json.RealTimeStress,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                    }]
            });

            //初级电流
            myChart2.setOption({
                title: {
                    text: '初级电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        show: true,
                        data: json.RealTime1stCurrentTimePoints
                    }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} A'
                    }
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.RealTime1stCurrent,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                    }]
            });


            //电阻
            myChart3.setOption({
                title: {
                    text: '电阻'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        show: true,
                        data: json.RealTimeResistenceTimePoints
                    }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} Ω'
                    }
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.RealTimeResistence,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                    }]
            });
        }
    });
}

//涂胶曲线图
function sealwelding(id) {
    showordisplaybydiv(0);
    var url2 = "api/SealUnitMeasurementHistory?Part_Serial=" + $('#partSerial').val() + "&Pass_No=" + id;
    //后台数据加载
    $.ajax({
        type: "get",
        //async:false,
        contenttype: "applicaton/json;charset=utf-8",
        url: url2,
        datatype: 'json',
        success: function (json) {

            myChart.hideLoading();
            myChart2.hideLoading();
            myChart3.hideLoading();

            //debugger;
            if (json.RealTimePassFlowRates.length <= 1) {
                myChart.clear();
                myChart2.clear();
                myChart3.clear();
                return;
            }

            //流量
            myChart.setOption({
                title: {
                    text: '流量'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        show: true,
                        data: json.RealTimePassFlowRateTimePoints
                    }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} M'
                    }
                }],
                series: [
                    {
                        name: '流量',
                        type: 'line',
                        data: json.RealTimePassFlowRates,
                    }]
            });

            //温度
            myChart2.setOption({
                title: {
                    text: '温度'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        show: true,
                        data: json.RealTimeTemperatureTimePoints
                    }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} °c'
                    }
                }],
                series: [
                    {
                        name: '温度',
                        type: 'line',
                        data: json.RealTimeTemperature,
                    }]
            });


            //胶枪压力
            myChart3.setOption({
                title: {
                    text: '胶枪压力'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                    {
                        type: 'category',
                        show: true,
                        data: json.RealTimeTorqueTimePoints
                    }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    }
                }],
                series: [
                    {
                        name: '压力',
                        type: 'line',
                        data: json.RealTimeTorque,
                    }]
            });
        }
    });
}


//打磨曲线图
function polishwelding(id) {
    showordisplaybydiv(1);
    var url3 = "api/PolishUnitMeasurementHistory?Part_Serial=" + $('#partSerial').val() + "&Pass_No=" + id;
    //后台数据加载
    $.ajax({
        type: "get",
        //async:false,
        contenttype: "applicaton/json;charset=utf-8",
        url: url3,
        datatype: 'json',
        success: function (json) {
           
            myChart.hideLoading();
            myChart2.hideLoading();
            myChart3.hideLoading();
            myChart4.hideLoading();
            myChart5.hideLoading();
            myChart6.hideLoading();

            
            if (json.J1_Current_TimePoints.length <= 1) {
                myChart.clear();
                myChart2.clear();
                myChart3.clear();
                myChart4.clear();
                myChart5.clear();
                myChart6.clear();
                return;
            }

            //打磨
            myChart.setOption({
                title: {
                    text: 'J1轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J1_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J1CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J1CurrentLSL,
                        lte: json.J1CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J1CurrentAbsAvg,
                        lte: json.J1CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J1CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J1_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J1CurrentLSL
                            },
                            {
                                yAxis: json.J1CurrentAbsAvg
                            }, {
                                yAxis: json.J1CurrentUSL
                            }
                            ]
                        }
                    }]
            });

            myChart2.setOption({
                title: {
                    text: 'J2轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J2_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J2CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J2CurrentLSL,
                        lte: json.J2CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J2CurrentAbsAvg,
                        lte: json.J2CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J2CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J2_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J2CurrentLSL
                            },
                            {
                                yAxis: json.J2CurrentAbsAvg
                            }, {
                                yAxis: json.J2CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart3.setOption({
                title: {
                    text: 'J3轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J3_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J3CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J3CurrentLSL,
                        lte: json.J3CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J3CurrentAbsAvg,
                        lte: json.J3CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J3CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J3_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J3CurrentLSL
                            },
                            {
                                yAxis: json.J3CurrentAbsAvg
                            }, {
                                yAxis: json.J3CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart4.setOption({
                title: {
                    text: 'J4轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J4_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J4CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J4CurrentLSL,
                        lte: json.J4CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J4CurrentAbsAvg,
                        lte: json.J4CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J4CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J4_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J4CurrentLSL
                            },
                            {
                                yAxis: json.J4CurrentAbsAvg
                            }, {
                                yAxis: json.J4CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart5.setOption({
                title: {
                    text: 'J5轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J5_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J5CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J5CurrentLSL,
                        lte: json.J5CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J5CurrentAbsAvg,
                        lte: json.J5CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J5CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J5_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J5CurrentLSL
                            },
                            {
                                yAxis: json.J5CurrentAbsAvg
                            }, {
                                yAxis: json.J5CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart6.setOption({
                title: {
                    text: 'J6轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J6_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J6CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J6CurrentLSL,
                        lte: json.J6CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J6CurrentAbsAvg,
                        lte: json.J6CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J6CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J6_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J6CurrentLSL
                            },
                            {
                                yAxis: json.J6CurrentAbsAvg
                            }, {
                                yAxis: json.J6CurrentUSL
                            }
                            ]
                        }
                    }]
            });

        }
    });
}

//冲压曲线图
function presswelding(id) {

    showordisplaybydiv(1);
    var url3 = "api/PressUnitMeasurementHistory?Part_Serial=" + $('#partSerial').val() + "";
    //后台数据加载
    $.ajax({
        type: "get",
        //async:false,
        contenttype: "applicaton/json;charset=utf-8",
        url: url3,
        datatype: 'json',
        success: function (json) {

            myChart.hideLoading();
            myChart2.hideLoading();
            myChart3.hideLoading();
            myChart4.hideLoading();
            myChart5.hideLoading();
            myChart6.hideLoading();

            debugger;
            if (json.J1_Current_TimePoints.length <= 1) {
                myChart.clear();
                myChart2.clear();
                myChart3.clear();
                myChart4.clear();
                myChart5.clear();
                myChart6.clear();
                return;
            }

            //冲压
            myChart.setOption({
                title: {
                    text: 'J1轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J1_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J1CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J1CurrentLSL,
                        lte: json.J1CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J1CurrentAbsAvg,
                        lte: json.J1CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J1CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J1_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J1CurrentLSL
                            },
                            {
                                yAxis: json.J1CurrentAbsAvg
                            }, {
                                yAxis: json.J1CurrentUSL
                            }
                            ]
                        }
                    }]
            });

            myChart2.setOption({
                title: {
                    text: 'J2轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J2_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J2CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J2CurrentLSL,
                        lte: json.J2CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J2CurrentAbsAvg,
                        lte: json.J2CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J2CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J2_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J2CurrentLSL
                            },
                            {
                                yAxis: json.J2CurrentAbsAvg
                            }, {
                                yAxis: json.J2CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart3.setOption({
                title: {
                    text: 'J3轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J3_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J3CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J3CurrentLSL,
                        lte: json.J3CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J3CurrentAbsAvg,
                        lte: json.J3CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J3CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J3_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J3CurrentLSL
                            },
                            {
                                yAxis: json.J3CurrentAbsAvg
                            }, {
                                yAxis: json.J3CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart4.setOption({
                title: {
                    text: 'J4轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J4_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J4CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J4CurrentLSL,
                        lte: json.J4CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J4CurrentAbsAvg,
                        lte: json.J4CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J4CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J4_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J4CurrentLSL
                            },
                            {
                                yAxis: json.J4CurrentAbsAvg
                            }, {
                                yAxis: json.J4CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart5.setOption({
                title: {
                    text: 'J5轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J5_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J5CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J5CurrentLSL,
                        lte: json.J5CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J5CurrentAbsAvg,
                        lte: json.J5CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J5CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J5_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J5CurrentLSL
                            },
                            {
                                yAxis: json.J5CurrentAbsAvg
                            }, {
                                yAxis: json.J5CurrentUSL
                            }
                            ]
                        }
                    }]
            });
            myChart6.setOption({
                title: {
                    text: 'J6轴电流'
                },
                tooltip: {
                    trigger: 'axis'
                },
                toolbox: {
                    feature: {
                        dataView: { show: true, readOnly: false },
                        magicType: { show: true, type: ['line', 'bar'] },
                        restore: { show: true },
                        saveAsImage: { show: true }
                    }
                },
                xAxis: [
                   {
                       type: 'category',
                       show: true,
                       data: json.J6_Current_TimePoints,
                   }
                ],
                yAxis: [{
                    type: 'value',
                    // name: 'anpei',
                    // min: 0,
                    // max: 25,
                    position: 'left',
                    boundaryGap: ['30%', '30%'],
                    axisLabel: {
                        formatter: '{value} ▲'
                    },

                }],
                visualMap: {
                    bottom: 20,
                    right: 0,
                    pieces: [{
                        gt: 0,
                        lte: json.J6CurrentLSL,
                        color: '#ffde33'
                    }, {
                        gt: json.J6CurrentLSL,
                        lte: json.J6CurrentAbsAvg,
                        color: '#096'
                    }, {
                        gt: json.J6CurrentAbsAvg,
                        lte: json.J6CurrentUSL,
                        color: '#096'
                    }, {
                        gt: json.J6CurrentUSL,
                        color: '#cc0033'
                    }],
                    outOfRange: {
                        color: '#999'
                    }
                },
                dataZoom: [{
                    type: 'inside',
                    start: 0,
                    end: 100
                }],
                series: [
                    {
                        name: '电流',
                        type: 'line',
                        data: json.J6_Current,
                        markPoint: {
                            data: [
                                { type: 'max', name: '最大值', symbol: 'diamond' },
                                { type: 'min', name: '最小值', symbol: 'arrow' }
                            ]
                        },
                        markLine: {
                            silent: true,
                            data: [{
                                yAxis: json.J6CurrentLSL
                            },
                            {
                                yAxis: json.J6CurrentAbsAvg
                            }, {
                                yAxis: json.J6CurrentUSL
                            }
                            ]
                        }
                    }]
            });

        }
    });
}


function showordisplaybydiv(flag) {
    if (flag == 1) {
        for (var i = 1; i < 7; i++) {
            $("#Diagramchart" + i + "").show();
        }
    } else if (flag == 0) {
        for (var i = 4; i < 7; i++) {
            $("#Diagramchart" + i + "").hide();
        }
    } else if (flag == 2) {
        for (var i = 3; i < 7; i++) {
            $("#Diagramchart" + i + "").hide();
        }
    }
}